﻿CREATE FUNCTION [dbo].[fn_ObjectType]
(
	@Object sysname
)
RETURNS VARCHAR(2)
AS
BEGIN
	RETURN (
	    SELECT o.[type]
	    FROM   sys.objects o
	    WHERE  o.[name] = @Object
	)
END